import axios from "axios";


const API_HOST = process.env.VUE_APP_API_HOST;

export function getHomeData() {
  return axios
    .get(`${API_HOST}/system/page/content/list?categoryId=1000&recommend=1`)
    .then((response) => {
      console.log("接口响应数据:", response.data);
      return response.data;
    })
    .catch((error) => {
      console.error("接口调用出错:", error);
      throw error;
    });
}
export function getAboutData() {
  return axios
    .get(`${API_HOST}/system/page/content/list?categoryId=1001&recommend=1`)
    .then((response) => {
      console.log("接口响应数据:", response.data);
      return response.data;
    })
    .catch((error) => {
      console.error("接口调用出错:", error);
      throw error;
    });
}
export function getServiceData() {
  return axios
    .get(`${API_HOST}/system/page/content/list?categoryId=1003&recommend=1`)
    .then((response) => {
      console.log("接口响应数据:", response.data);
      return response.data;
    })
    .catch((error) => {
      console.error("接口调用出错:", error);
      throw error;
    });
}
export function getCompanyData() {
  return axios
    .get(`${API_HOST}/system/page/content/list?categoryId=1004&recommend=1`)
    .then((response) => {
      console.log("接口响应数据:", response.data);
      return response.data;
    })
    .catch((error) => {
      console.error("接口调用出错:", error);
      throw error;
    });
}
export function getRecruitData() {
  return axios
    .get(`${API_HOST}/system/page/content/list?categoryId=1006&recommend=1`)
    .then((response) => {
      console.log("招聘接口响应数据:", response.data);
      return response.data;
    })
    .catch((error) => {
      console.error("招聘接口调用出错:", error);
      throw error;
    });
}

export function getProjectData() {
  return axios
    .get(`${API_HOST}/system/page/content/list?categoryId=1002&recommend=1`)
    .then((response) => {
      console.log("招聘接口响应数据:", response.data);
      return response.data;
    })
    .catch((error) => {
      console.error("招聘接口调用出错:", error);
      throw error;
    });
}
export function getNewsData() {
  return axios
    .get(`${API_HOST}/system/page/content/list?categoryId=1005&recommend=1`)
    .then((response) => {
      console.log("招聘接口响应数据:", response.data);
      return response.data;
    })
    .catch((error) => {
      console.error("招聘接口调用出错:", error);
      throw error;
    });
}
